package com.eben.model;

import android.graphics.Canvas;
import android.graphics.Color;

public class HealthPoint extends GameObject{

	private int health;
	
	public HealthPoint(){
		this(0, 0, new Position(0,0), 10, Color.GREEN, 5);
	}
	
	/**
	 * Creates a fully customizable healthPoint
	 * @param velocity the speed of the healthPoint
	 * @param direction the direction of the healthPoint
	 * @param position the starting position of the healthPoint
	 * @param radius the radius of the healthPoint
	 * @param color the color of the healthPoint
	 * @param points how many points the point is worth
	 */
	public HealthPoint(double velocity, double direction, Position position, int radius, int color, int health){
		super(velocity, direction, position, radius, color);
		this.setHealth(health);
		paint.setColor(color);
	}
	/**
	 * Creates a healthPoint with 0 velocity and 0 direction.
	 * @param position the starting position
	 * @param radius the radius of the healthPoint
	 * @param color the color of the healthPoint
	 * @param points how much life the healthPoint is worth
	 */
	public HealthPoint(Position position, int radius, int color, int health){
		this(0, 0, position, radius, color, health);
	}
	
	/**
	 * Creates a healthPoint with 0 velocity and 0 direction with standard radius, color and health.
	 * @param position the starting position of the healthPoint.
	 */
	public HealthPoint(Position position) {
		this(0, 0, position, 5, Color.YELLOW, 5);
	}
	
	@Override
	public void draw(Canvas canvas) {
		canvas.drawCircle((float)position.getX(), (float)position.getY(), radius, paint);
	}

	@Override
	public void updatePosition() {
		//Does nothing because a Point is still at the moment.
	}
	
	public void setHealth(int health) {
		this.health = health;
	}
	
	public int getHealth() {
		return health;
	}

	public void setColor(int color) {
		paint.setColor(color);
	}
}